<!DOCTYPE html>
<html>
	<head>
		<#include "/templates/commons/head.html">
		<script src="${ctx!}/scripts/third/md5.js" type="text/javascript"></script>
		<script type="text/javascript">
			function dialogSave(_callback){
				if(!$("#addForm").validateForm()){
				    return;
			    }
				//判断用户是否存在
				var adminAccount = $("#param_adminAccount").val();
				var flag = "";
				Common.network("${ctx!}/UserController/checkUserId.do", "POST", {"param_adminAccount" : adminAccount}, false, function(data) {
				    flag = data;
				})
			    if(flag == '1'){
					layer.alert("帐号已存在，请重新输入！");
					return;
				}
				layer.confirm("您是否确定要添加？", {
					    btn: ['确定', '取消']
					}, function() {
					    //密码md5加密
					    $("#before").val(hex_md5($("#before").val()));
					    //提交
					    Common.network("${ctx!}/OrgController/adminAddSave.do", "POST", $(document.addForm).serialize(), false, _callback);
				    }, function() {
			    });
			}
		</script>
		<style type="text/css">
			.layui-form-label {
				width: 100px !important;
			}
			.layui-input-block {
				margin-left: 130px !important;
			}
		</style>
	</head>
	<body>
		<div id="div-body" class="body">
			<div class="hid-scroller-body">
				<!-- 标题 Start -->
				<#include "/templates/commons/menuPath.html">
				<!-- 标题 End -->
				<form id="addForm" name="addForm" class="layui-form" method="post">
					<div class="main-container">
						<!-- list页面搜索条件 Start -->
						<input type="hidden" name="orgId" value="${orgBean.orgId!}"/>
						<input type="hidden" name="orgName" value="${orgBean.orgName!}"/>
						<input type="hidden" name="status" value="${orgBean.status!}"/>
						<input type="hidden" id="cityCode" name="cityCode" value="${orgBean.cityCode!}"/>
						<!-- list页面搜索条件 End -->
						<div class="layui-form-item">
							<label class="layui-form-label"><span class="redSpan">*</span>机构管理员帐号:</label>
							<div class="layui-input-block">
								<input type="text" name="adminAccount" id="param_adminAccount" autocomplete="off" isValidate="true" notEmpty="true" size="20" leng="20" isCharOrNum="true" placeholder="请输入机构管理员帐号" class="layui-input" lay-verify="title"/>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"><span class="redSpan">*</span>机构管理员密码:</label>
							<div class="layui-input-block">
								<input type="password" name="adminPassword" id="before" isValidate="true" autocomplete="off" notEmpty="true" isCharOrNum="true" leng="32" placeholder="机构管理员密码" class="layui-input" lay-verify="title"/>
							</div>
						</div>	
					</div>
				</form>
			</div>
		</div>
	</body>
</html>